import type { NotificationModalConfig } from "@/models/modalModel"
import { Button, Modal } from "antd"

interface Props {
  config: NotificationModalConfig
  onCancel: () => void
}

const NotificationModal: React.FC<Props> = ({ config, onCancel }) => {
  return (
    <Modal
      title={
        <span style={{ fontSize: "18px", fontWeight: "bold", color: "#1890ff" }}>
          {config.title}
        </span>
      }
      width={800}
      open={config.visible}
      centered
      closable={true}
      onCancel={onCancel}
      footer={[
        <Button
          key="ok"
          type="primary"
          size="large"
          onClick={onCancel}
          style={{ width: 120 }}
        >
          确定
        </Button>
      ]}
    >
      <div
        style={{
          fontSize: "16px",
          color: "#000000d9",
          textAlign: "center",
          padding: "20px 0"
        }}
      >
        {config.content}
      </div>
    </Modal>
  )
}

export default NotificationModal
